<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('RPA月度数据有效转换数据列表')"/>
</head>
<body class="pear-container">
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">指标年月</label>
                <div class="layui-input-inline">
                    <input type="text" name="taskmonth" placeholder="" class="layui-input">
                </div>
                <label class="layui-form-label">业务编码</label>
                <div class="layui-input-inline">
                    <input type="text" name="typenum" placeholder="" class="layui-input">
                </div>
                <label class="layui-form-label">供电所名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="selfsupplyname" placeholder="" class="layui-input">
                </div>
                <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit
                        lay-filter="viewrpa-query">
                    <i class="layui-icon layui-icon-search"></i>
                    查询
                </button>
                <button type="reset" class="pear-btn pear-btn-md">
                    <i class="layui-icon layui-icon-refresh"></i>
                    重置
                </button>
            </div>
        </form>
    </div>
</div>
<div class="layui-card">
    <div class="layui-card-body">
        <table id="viewrpa-table" lay-filter="viewrpa-table"></table>
    </div>
</div>
</body>

<th:block th:include="include :: footer"/>
<script>
    layui.use(['table', 'form', 'jquery'], function () {
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;

        var MODULE_PATH = rootPath + "/RpaTransdataController/";
        var cols = [
            [

                {title: '业务类型编码', field: 'typenum', align: 'center'},

                {title: '业务类型名称', field: 'typename', align: 'center'},

                {title: '指标年月', field: 'taskmonth', align: 'center'},

                {title: '分公司名称', field: 'subcompanyname', align: 'center',width:280},

                // {title: '外系统供电所名称', field: 'supplyname', align: 'center'},
                //
                // {title: '内部供电所id', field: 'selfsupplyid', align: 'center'},

                {title: '供电所名称', field: 'selfsupplyname', align: 'center'},

                {title: '数据描述', field: 'datamemo', align: 'center'},

                {title: '数据值', field: 'value', align: 'center'},

                {title: '对应指标id', field: 'targetid', align: 'center'},

                // {title: '对应月度任务id', field: 'taskid', align: 'center'},
                //
                // {title: '是否完成数据自动填写（0否1是）', field: 'isfinish', align: 'center'},
                //
                // {title: '操作', toolbar: '#viewrpa-bar', align: 'center'}
            ]
        ]

        //table表单列表
        table.render({
            elem: '#viewrpa-table',
            url: MODULE_PATH + 'list',
            page: true,
            method: 'get',
            cols: cols,
            skin: 'line',
            toolbar: '#viewrpa-toolbar',
            limit:80,
            defaultToolbar: [{
                layEvent: 'refresh',
                icon: 'layui-icon-refresh',
            }]
        });

        //table图标事件绑定
        table.on('tool(viewrpa-table)', function (obj) {
            if (obj.event === 'remove') {
                window.remove(obj);
            } else if (obj.event === 'edit') {
                window.edit(obj);
            }
        });

        //table工具栏绑定
        table.on('toolbar(viewrpa-table)', function (obj) {
            if (obj.event === 'add') {
                window.add();
            } else if (obj.event === 'refresh') {
                window.refresh();
            } else if (obj.event === 'batchRemove') {
                window.batchRemove(obj);
            }
        });

        //查询按钮绑定
        form.on('submit(viewrpa-query)', function (data) {
            table.reload('viewrpa-table', {where: data.field})
            return false;
        });

        //刷新按钮
        window.refresh = function () {
            table.reload('viewrpa-table');
        }
    })
</script>
</html>